package com.gzz.controller;

import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
public class TestController {
	@RequestMapping("hello")
	public String hello() {
		return "hello";
	}

	@RequestMapping("getOne")
	public User save(Integer id) {
		User user = new User();
		user.setName("李四");
		user.setId(id);
		return user;
	}

	@RequestMapping("update")
	public User update(User user) {
		return user;
	}

	@RequestMapping("insert")
	public User insert(@RequestBody User user) {
		return user;
	}

	@RequestMapping(value = "select", method = RequestMethod.GET)
	public List<User> select(User user) {
		List<User> list = new ArrayList<>();
		list.add(user);
		return list;
	}
}
